clear all;
close all;
clc;




% image_double = double(image/256);
% image_after_transform = imresize(image_double, [15 18], 'bicubic');
% matrix = uint8(image_after_transform*256);
% vector = image_after_transform(:);



avr = 0;
a = cputime;
% for i = 1:1000

    im = imread('ORL/s12/7.pgm');
    im = imresize(im, .2, 'bicubic');
    figure(1);
    imshow(im);
    [vector matrix] = im2life(im);
    figure(2);
    imshow(matrix);
%     image = double(im);
%     image_after_transform = abs(image(1:end-1 ,:) - image(2:end ,:));
%     image_after_transform = uint8(image_after_transform);
%     vector = image_after_transform(:);
    
    
    
%         image_after_transform = abs(dct2(image_double));
%     image_after_transform = image_after_transform(1:15, 1:15);
%             
%     vector = image_after_transform(:);
%     imshow(vector);
%     vector = vector(2:end);
    
% end
b = cputime;
b = b - a;
disp(b);

b = b / 1000;
disp(b);




% image_after_transform = abs(fft2(image_double));
% image_after_transform = image_after_transform(1:20, 1:20);

% matrix = uint8(image_after_transform);
% vector = image_after_transform(:);        
% vector = vector(2:end); 